home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / HyperCard / FoneBookMaker 1.0 / FoneBookMaker / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1993-02-13  |  8.7 KB  |  20 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>1</cardCount>
  7.     <cardID>2962</cardID>
  8.     <listID>2113</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>544</width>
  14.         <height>192</height>
  15.     </cardSize>
  16.     <script>-- FoneBookMaker by Robert Mason-- ¬© 1993 by HyperCode Software-- Written primarly to convert a TouchBase exported file into a wallet--- size notebook I designed.-- This script expects the exported file to be tab delimited fields in-- the following order: Last Name, First Name, Phone1, Phone2, City,-- State, Zip. Seven fields. If the file is arranged any other way, this-- script won't work.-- This stack requires version 2.1 of HyperCard to work properly unless-- you know a little HyperTalk. I used Set ItemDelimiter which is only-- available in version 2.1 and above. You could delete that instruction-- and export your files with comma delimited fields. This will work,-- but any fields with commas in them will create confusion which is why-- I used tab-delimiting.on openstackget the versionif it < 2.1 thenanswer "This stack requires HyperCard version 2.1 or greater " &¬¨"to work properly."end ifmakeMenuend openstackon domenu whichif which is "Help" thenshow cd fld "Instructions"elsepass domenuend ifend domenuon makeMenuset the name of menuItem 1 of menu "Apple" to "About FoneBookMaker"set menuMsg of menuItem "About FoneBookMaker" of menu "Apple" to Infoend makeMenuon infoanswer "FoneBookMaker 1.0  by Robert Mason" & return & " ¬© 1993 by HyperCode Software"end infoon opencardput the number of this cd & " of " & the number of cds into fld "page"end opencardon printFone Kind,Sizeif Kind = "Wallet" thenprintWallet SizeelseprintBook Sizeend ifend printFoneon PrintWallet Size -- varible "size" allows for different formats laterset cursor to watchrepeat with i = 1 to the number of cds -- 4 wallet pages per pageopen report printing with template "Wallet"print card iclose printingend repeatgo first cdend PrintWalleton printBook Sizeopen report printing with template "NoteBook"print all cardsclose printingend printBookon makeFoneBook Kind,Sizeanswer file "Which file?"if the result is "cancel" then exit makeFoneBookput it into filename-- put "TouchBase.Export" into filenamerepeat 40put "." after Spacer        -- create a dotted line for empty fieldsend repeatopen file filenamerepeat until it is empty -- read until everything is read from fileread from file filename for 30000put return & it after TheListend repeatclose file filenameput Kind & "," & Size into fld BookType -- to notify print functionrepeat while line 1 of TheList is emptydelete line 1 of TheListend repeatset itemDelimiter to tabrepeat with i = 1 to the number of lines of TheListset cursor to busyput line i of TheList into WorkingLineput item 1 of WorkingLine into Tempif Temp is not empty then put i && Tempif Temp is not empty then put ", " after Tempput item 2 of WorkingLine after Tempput length(Temp) into HBif HB ‚â• 24 thenrepeat until length(Temp) = 23delete last char of Tempend repeatput "." after Tempend ifput char 1 to (24 - HB) of Spacer after Tempput Temp into LineTemp --------------------------- Lname, fnameput item 3 of WorkingLine & " " & item 4 of WorkingLine into Tempput length(Temp) into HBif HB ‚â• 36 thenrepeat until length(Temp) = 35delete last char of Tempend repeatput "." after Tempend ifput char 1 to (36 - HB) of Spacer after Tempput Temp after LineTemp ------------------------- phone #put item 5 of WorkingLine into Tempput length(Temp) into HBif HB ‚â• 34 thenrepeat until length(Temp) = 33delete last char of Tempend repeatput "." after Tempend ifput char 1 to (34 - HB) of Spacer after Tempput Temp after LineTemp ------------------------- addressif item 6 of WorkingLine is not empty thenput item 6 of WorkingLine & ", " & item 7 of WorkingLine & ¬¨"  " & item 8 of WorkingLine into Tempelseif item 7 of WorkingLine is not empty thenput item 7 of WorkingLine & "  " & item 8 of WorkingLine into Tempelseput item 8 of WorkingLine into Tempend ifend ifput length(Temp) into HBif HB ‚â• 32 thenrepeat until length(Temp) = 32delete last char of Tempend repeatend ifif Temp is empty thenput ".............................." into Temp -- if no city,state,zipend ifput Temp after LineTemp ------------------------- City,State,Zipput LineTemp & return after FoneBookTemp -- put Temp & return after VapFoneend repeat-------------------------- what kind?if Kind = "Wallet" thenput FormatWalletBook(FoneBookTemp,Size) into FoneBookTempelseput FormatFoneBook(FoneBookTemp,Size) into FoneBookTempend ifBuildPreview FoneBookTemp,Sizego first cdhide msgbeep 2end MakeFoneBookon BuildPreview FoneBookTemp,Sizeglobal CutHereput "Building preview windows..."repeat with i = 1 to the number of cds - 1go last cddomenu "delete card"end repeatput empty into fld 1 -- clear first fieldif Size = 9 thenset the textsize of fld "FoneText" to 9set the textstyle of fld "FoneText" to condenseelseset the textsize of fld "FoneText" to 7set the textstyle of fld "FoneText" to plainend ifrepeat with i = 1 to the number of lines of FoneBookTempset cursor to busyif "¬ß" is not in line i of FoneBookTemp then --end of 4 page section-- put in by formatFoneBook function, tells program to start a-- new pageput line i of FoneBookTemp & return after FldTempelseput FldTemp after fld 1put empty into FldTempdomenu "new card"if Kind = "Wallet" then put CutHere & return into fld 1end ifend repeatput FldTemp after fld 1end BuildPreviewfunction formatWalletBook FoneBookTemp,Sizeglobal CutHere -- so it can be used during MakeFoneBook tooput empty into CutHereput "Formatting wallet pages..."if Size = 7 thenput 20 into NumOfLineselseput 12 into NumOfLinesend if---------------------- make the header and line cut lines -----------get the dateput it into fld "date"if length(it) ‚↠8 thenrepeat until length(it) = 8put "." after itend repeatend ifput it into WalPageHeaderrepeat 9put "....." after WalPageHeaderend repeatput " Index" after WalPageHeaderrepeat 6put "--------------------" after CutHereend repeatput "-----|" after CutHere---------------------------------------------------------------------put 1 into Lnum -- line counterput 0 into PBnum -- wallet page counter: PageBlockrepeatset cursor to busyput CutHere & return after FormatTemprepeat NumOfLines -- 12 or 20 corresponding to 7pt or 9pt in Sizeif line Lnum of FoneBookTemp is empty then exit repeat -- emptyput return & line Lnum of FoneBookTemp after PageBlockadd 1 to Lnumend repeatif line 1 of PageBlock is empty then delete first line of PageBlock -- empty lineadd 1 to PBnumif the number of lines of PageBlock = NumOfLines then -- 21put "(" & char 1 of line 1 of PageBlock & "-" & char 1 of line NumOfLines of ¬¨ -- 21PageBlock & ")" into PageIndexput PageIndex into last word of WalPageHeaderput WalPageHeader & return after FormatTempput PageBlock & return after FormatTempelsedelete last line of PageBlockput "(" & char 1 of line 1 of PageBlock & "-" & char 1 of last line of ¬¨PageBlock & ")" into PageIndexput PageIndex into last word of WalPageHeaderput WalPageHeader & return after FormatTempput the number of lines of PageBlock into PBLrepeat NumOfLines - PBL -- 21put return after PageBlockend repeat-- put CutHere into last line of PageBlockput CutHere after PageBlockput PageBlock after FormatTempexit repeatend ifput empty into PageBlockif PBnum = 4 then -- four wallet pages max to one printed pageput 0 into PBnumput CutHere after FormatTemp -- cut line for last page entry-- put CutHere into last line of FormatTempput return & "¬ß" after FormatTemp -- mark it for MakeFoneBookend ifend repeatreturn FormatTempend formatWalletBookfunction formatFoneBook FoneBookTemp,Sizeput "Formatting Pages..."put the date into fld "Date"put 1 into Numif Size = 7 thenput 98 into LineLimitput 98 into LIncrementelseput 62 into LineLimitput 62 into LIncrementend ifrepeatset cursor to busyput line Num to LineLimit of FoneBookTemp into Blockif the number of lines of Block < LIncrement thenput return & Block after Tempexit repeatend ifput Block & return & "¬ß" after Tempadd LIncrement to Numadd LIncrement to LineLimitend repeatreturn Tempend formatFoneBook</script>
  17.     <background id="2582" file="background_2582.xml" name="" />
  18.     <card id="2962" file="card_2962.xml" marked="false" name="" owner="2582" />
  19. </stack>
  20.